//
//  NavigationBar.m
//  Flava
//
//  Created by Ug-Code on 13-8-20.
//  Copyright (c) 2013年 UgCode. All rights reserved.
//

#import "NavigationBar.h"

@implementation NavigationBar
@synthesize shadow = _shadow;
- (id)init
{
    self = [super init];
    if (self) {
		UIImage *bgImage = [UIImage imageNamed:@"navigation_bar_bg.png"];
		bgImage = [bgImage resizableImageWithCapInsets:UIEdgeInsetsMake(5, 5, 0, 5)];
		self.backgroundImage = bgImage;
    }
    return self;
}

- (void)setShadow:(BOOL)shadow
{
	if (shadow == YES) {
		UIImage *shadowImage = [UIImage imageNamed:@"top_mask1.png"];
		shadowImage = [shadowImage stretchableImageWithLeftCapWidth:0 topCapHeight:0];
		UIImageView *shadowView = [[UIImageView alloc] initWithImage:shadowImage];
		shadowView.frame = CGRectMake(0, 44, 320, 10);
		[self addSubview:shadowView];
	}
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
